// @ts-expect-error 不需要检测
import request from '@/utils/request'
export function getProductList(query: unknown) {
  return request({
    url: '/web/finance/product/list',
    headers: {
      isToken: false,
    },
    method: 'get',
    params: query,
  })
}

export function getProduct(id: string) {
  return request({
    url: `/web/finance/product/${id}`,
    headers: {
      isToken: false,
    },
    method: 'get',
  })
}

export function getProductByUserOrg(query?: object) {
  return request({
    url: '/manage/product/listByOrg',
    method: 'get',
    params: query,
  })
}
export function getProducInfo(id: string) {
  return request({
    url: `/manage/product/${id}`,
    method: 'get',
  })
}

// 修改金融产品
export function updateBaseInfo(data) {
  return request({
    url: '/manage/product/updateBaseInfo',
    method: 'put',
    data: data,
  })
}

// 新增金融产品
export function addJrcp(data) {
  return request({
    url: '/manage/product',
    method: 'post',
    data: data,
  })
}

export function updateProduct(data?: object) {
  return request({
    url: '/manage/product',
    method: 'put',
    data: data,
  })
}
